package com.example.springbootjavafx;

import com.example.springbootjavafx.service.TestService;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.scene.control.Label;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;


@Component
public class HelloController {

    @Autowired
    private TestService testService;

    @FXML
    private Label welcomeText;

    @FXML
    protected void onHelloButtonClick() {
//        welcomeText.setText(CLibrary.INSTANCE.hello_dog_name("欢迎你来到JavaFx的世界！"));
        welcomeText.setText(testService.getHello());
    }

    @FXML
    public void onMyButtonClick(ActionEvent actionEvent) {
        welcomeText.setText(CLibrary.INSTANCE.hello_dog_name("jna调用动态链接库"));
//        welcomeText.setText("按了我的按钮");
    }
}